package edu.java.lectures.lec01.main;

public class TestPoint {

    public static void main(String[] args) {
	/*
	 * Executed the foollowing steps:
	 * 
	 * 1) separate space in the heap for the fields (instance variables) of
	 * the object
	 * 
	 * 2) cleaned the separated space from the existing value in the memory
	 * 
	 * 3) putting the default values for the corresponding fields
	 * 
	 * 4) putting the values (if any) initialized in the constructor
	 */
	Point2D a = new Point2D(3, 5);

	Point2D b = new Point2D();

	// System.out.println(a.toString());
	System.out.println("a=" + a);

	System.out.println("b=" + b);

	// double pX = a.x; // DO NOT WORK -> private access of the field
	double aX = a.getX();
	System.out.println(aX);

	// a.x = -1; // VERY VERY WRONG -> going to hell after such mistake ;P
	a.setX(-1);
	System.out.println(a);
    }
}
